package testeSelenium;

import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;

public class TestaCadastro2 extends SeleneseTestCase {
	public void setUp() throws Exception {
		setUp("http://localhost:8080/Lembrete/index.jsf", "*firefox");
	}
	public void testNew() throws Exception {
		selenium.open("/Lembrete/index.jsf");
		selenium.click("//a[contains(text(),'Crie uma conta')]");
		selenium.waitForPageToLoad("30000");
		selenium.type("document.forms[0].elements[0]", "administrador");
		selenium.type("document.forms[0].elements[1]", "admin@admin");
		selenium.type("document.forms[0].elements[2]", "admin");
		selenium.click("document.forms[0].elements[4]");
		selenium.waitForPageToLoad("30000");
		selenium.click("//form/a");
		selenium.waitForPageToLoad("30000");
		
		selenium.click("//a[contains(text(),'Crie uma conta')]");
		selenium.waitForPageToLoad("30000");
		selenium.type("document.forms[0].elements[0]", "admin");
		selenium.type("document.forms[0].elements[1]", "admin@gmail.com");
		selenium.type("document.forms[0].elements[2]", "admin");
		selenium.click("document.forms[0].elements[4]");
		selenium.waitForPageToLoad("30000");
		selenium.click("//form/a");
		selenium.waitForPageToLoad("30000");

		selenium.click("//a[contains(text(),'Crie uma conta')]");
		selenium.waitForPageToLoad("30000");
		selenium.type("document.forms[0].elements[0]", "odilon");
		selenium.type("document.forms[0].elements[1]", "odilonflj@gmail.com");
		selenium.type("document.forms[0].elements[2]", "odilon");
		selenium.click("document.forms[0].elements[4]");
		selenium.waitForPageToLoad("30000");
		selenium.click("//form/a");
		selenium.waitForPageToLoad("30000");
		selenium.click("//a[contains(text(),'Crie uma conta')]");
		selenium.waitForPageToLoad("30000");
		selenium.type("document.forms[0].elements[0]", "admin2");
		selenium.type("document.forms[0].elements[1]", "admin2");
		selenium.type("document.forms[0].elements[2]", "admin");
		selenium.click("document.forms[0].elements[4]");
		selenium.waitForPageToLoad("30000");
		selenium.click("//form/a");
		selenium.waitForPageToLoad("30000");
		selenium.type("document.forms[0].elements[0]", "");
	}
}
